//package com.zhouyu.config.channel;
//
//import io.netty.channel.ChannelInitializer;
//import io.netty.channel.ChannelPipeline;
//import io.netty.channel.socket.SocketChannel;
//import io.netty.handler.codec.protobuf.ProtobufEncoder;
//import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
//import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
//import io.netty.handler.timeout.IdleStateHandler;
//
//import java.util.concurrent.TimeUnit;
//
///**
// * @description: channel设置
// * @author: zhouyu
// * @create: 2020-05-09 11:26
// */
//public class ProtobufChannel extends ChannelInitializer<SocketChannel> {
//
//    @Override
//    protected void initChannel(SocketChannel socketChannel) throws Exception {
//        ChannelPipeline channelPipeline = socketChannel.pipeline();
//        //读写超时设置自
//        channelPipeline.addLast(new IdleStateHandler(5,5,5, TimeUnit.SECONDS));
//        //编解码器
//        channelPipeline.addLast(new ProtobufVarint32FrameDecoder());
//        //channelPipeline.addLast(new ProtobufDecoder(UserMsg.getDefaultInstance()));
//        channelPipeline.addLast(new ProtobufVarint32LengthFieldPrepender());
//        channelPipeline.addLast(new ProtobufEncoder());
//    }
//}
